const webpack = require('webpack')
const merge = require('webpack-merge');
const common = require('./webpack.common.js');

module.exports = merge(common, {
  devtool: 'inline-source-map',
  devServer: {
    contentBase: './dist',
    hot: true                   // 启用热更新
  },
  plugins: [
    new webpack.NamedModulesPlugin(),             // 以便更容易查看要修补(patch)的依赖
    new webpack.HotModuleReplacementPlugin()      // 引入webpack内置的模块热更新插件
  ]
})